<?php
class CheckUser extends Action {
	/*
	 * (non-PHPdoc) @see Action::execute()
	 */
	public function execute($params) {
		check_login ( ADMIN_LOGIN_PAGE );
		$type = rqst ( 'type', 'uname' );
		$userModel = new CoreUserModel ();
		if ($type == 'uname') {
			$where ['uname'] = rqst ( 'uname' );
		} else {
			$where ['email'] = rqst ( 'email' );
		}
		$uid = irqst ( 'uid', 0 );
		if (! empty ( $uid )) { //修改时
			$where ['uid !='] = $uid;
		}
		@header ( 'Content-type: application/json', true );
		echo $userModel->exist ( $where ) ? 'false' : 'true';
	}
}